package edu.unf.cen6940.web;

import edu.unf.cen6940.dao.FacultyDAO;
import edu.unf.cen6940.dao.ThesisDAO;
import edu.unf.cen6940.dao.ThesiscommitteeDAO;

import edu.unf.cen6940.domain.Faculty;
import edu.unf.cen6940.domain.Thesis;
import edu.unf.cen6940.domain.Thesiscommittee;

import edu.unf.cen6940.service.ThesiscommitteeService;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;

import org.springframework.web.bind.WebDataBinder;

import org.springframework.web.bind.annotation.InitBinder;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import org.springframework.web.servlet.ModelAndView;

/**
 * Spring MVC controller that handles CRUD requests for Thesiscommittee entities
 * 
 */

@Controller("ThesiscommitteeController")
public class ThesiscommitteeController {

	/**
	 * DAO injected by Spring that manages Faculty entities
	 * 
	 */
	@Autowired
	private FacultyDAO facultyDAO;

	/**
	 * DAO injected by Spring that manages Thesis entities
	 * 
	 */
	@Autowired
	private ThesisDAO thesisDAO;

	/**
	 * DAO injected by Spring that manages Thesiscommittee entities
	 * 
	 */
	@Autowired
	private ThesiscommitteeDAO thesiscommitteeDAO;

	/**
	 * Service injected by Spring that provides CRUD operations for Thesiscommittee entities
	 * 
	 */
	@Autowired
	private ThesiscommitteeService thesiscommitteeService;

	/**
	 * Create a new Thesis entity
	 * 
	 */
	@RequestMapping("/newThesiscommitteeThesises")
	public ModelAndView newThesiscommitteeThesises(@RequestParam Integer thesiscommittee_thesisCommitteeId) {
		ModelAndView mav = new ModelAndView();
		mav.addObject("thesiscommittee_thesisCommitteeId", thesiscommittee_thesisCommitteeId);
		mav.addObject("thesis", new Thesis());
		mav.addObject("newFlag", true);
		mav.setViewName("thesiscommittee/thesises/editThesises");

		return mav;
	}

	/**
	 * Create a new Faculty entity
	 * 
	 */
	@RequestMapping("/newThesiscommitteeFacultyByCommitteeMember5")
	public ModelAndView newThesiscommitteeFacultyByCommitteeMember5(@RequestParam Integer thesiscommittee_thesisCommitteeId) {
		ModelAndView mav = new ModelAndView();
		mav.addObject("thesiscommittee_thesisCommitteeId", thesiscommittee_thesisCommitteeId);
		mav.addObject("faculty", new Faculty());
		mav.addObject("newFlag", true);
		mav.setViewName("thesiscommittee/facultybycommitteemember5/editFacultyByCommitteeMember5");

		return mav;
	}

	/**
	 * View an existing Faculty entity
	 * 
	 */
	@RequestMapping("/selectThesiscommitteeFacultyByCommitteeMember1")
	public ModelAndView selectThesiscommitteeFacultyByCommitteeMember1(@RequestParam Integer thesiscommittee_thesisCommitteeId, @RequestParam Integer facultybycommitteemember1_facultyId) {
		Faculty faculty = facultyDAO.findFacultyByPrimaryKey(facultybycommitteemember1_facultyId, -1, -1);

		ModelAndView mav = new ModelAndView();
		mav.addObject("thesiscommittee_thesisCommitteeId", thesiscommittee_thesisCommitteeId);
		mav.addObject("faculty", faculty);
		mav.setViewName("thesiscommittee/facultybycommitteemember1/viewFacultyByCommitteeMember1");

		return mav;
	}

	/**
	 * Show all Faculty entities by Thesiscommittee
	 * 
	 */
	@RequestMapping("/listThesiscommitteeFacultyByCommitteeMember3")
	public ModelAndView listThesiscommitteeFacultyByCommitteeMember3(@RequestParam Integer thesisCommitteeIdKey) {
		ModelAndView mav = new ModelAndView();

		mav.addObject("thesiscommittee", thesiscommitteeDAO.findThesiscommitteeByPrimaryKey(thesisCommitteeIdKey));
		mav.setViewName("thesiscommittee/facultybycommitteemember3/listFacultyByCommitteeMember3");

		return mav;
	}

	/**
	 * Delete an existing Thesis entity
	 * 
	 */
	@RequestMapping("/deleteThesiscommitteeThesises")
	public ModelAndView deleteThesiscommitteeThesises(@RequestParam Integer thesiscommittee_thesisCommitteeId, @RequestParam Integer related_thesises_thesisId) {
		ModelAndView mav = new ModelAndView();

		Thesiscommittee thesiscommittee = thesiscommitteeService.deleteThesiscommitteeThesises(thesiscommittee_thesisCommitteeId, related_thesises_thesisId);

		mav.addObject("thesiscommittee_thesisCommitteeId", thesiscommittee_thesisCommitteeId);
		mav.addObject("thesiscommittee", thesiscommittee);
		mav.setViewName("thesiscommittee/viewThesiscommittee");

		return mav;
	}

	/**
	 * Select the Thesiscommittee entity for display allowing the user to confirm that they would like to delete the entity
	 * 
	 */
	@RequestMapping("/confirmDeleteThesiscommittee")
	public ModelAndView confirmDeleteThesiscommittee(@RequestParam Integer thesisCommitteeIdKey) {
		ModelAndView mav = new ModelAndView();

		mav.addObject("thesiscommittee", thesiscommitteeDAO.findThesiscommitteeByPrimaryKey(thesisCommitteeIdKey));
		mav.setViewName("thesiscommittee/deleteThesiscommittee");

		return mav;
	}

	/**
	 * Select an existing Thesiscommittee entity
	 * 
	 */
	@RequestMapping("/selectThesiscommittee")
	public String selectThesiscommittee(@RequestParam Integer thesisCommitteeIdKey, Model model) {

		model.addAttribute("thesiscommittee", thesiscommitteeDAO.findThesiscommitteeByPrimaryKey(thesisCommitteeIdKey));
		return "thesiscommittee/viewThesiscommittee";
	}

	/**
	 * Create a new Faculty entity
	 * 
	 */
	@RequestMapping("/newThesiscommitteeFacultyByCommitteeMember3")
	public ModelAndView newThesiscommitteeFacultyByCommitteeMember3(@RequestParam Integer thesiscommittee_thesisCommitteeId) {
		ModelAndView mav = new ModelAndView();
		mav.addObject("thesiscommittee_thesisCommitteeId", thesiscommittee_thesisCommitteeId);
		mav.addObject("faculty", new Faculty());
		mav.addObject("newFlag", true);
		mav.setViewName("thesiscommittee/facultybycommitteemember3/editFacultyByCommitteeMember3");

		return mav;
	}

	/**
	 * Select the child Faculty entity for display allowing the user to confirm that they would like to delete the entity
	 * 
	 */
	@RequestMapping("/confirmDeleteThesiscommitteeFacultyByCommitteeMember2")
	public ModelAndView confirmDeleteThesiscommitteeFacultyByCommitteeMember2(@RequestParam Integer thesiscommittee_thesisCommitteeId, @RequestParam Integer related_facultybycommitteemember2_facultyId) {
		ModelAndView mav = new ModelAndView();

		mav.addObject("faculty", facultyDAO.findFacultyByPrimaryKey(related_facultybycommitteemember2_facultyId));
		mav.addObject("thesiscommittee_thesisCommitteeId", thesiscommittee_thesisCommitteeId);
		mav.setViewName("thesiscommittee/facultybycommitteemember2/deleteFacultyByCommitteeMember2");

		return mav;
	}

	/**
	 * View an existing Faculty entity
	 * 
	 */
	@RequestMapping("/selectThesiscommitteeFacultyByCommitteeMember4")
	public ModelAndView selectThesiscommitteeFacultyByCommitteeMember4(@RequestParam Integer thesiscommittee_thesisCommitteeId, @RequestParam Integer facultybycommitteemember4_facultyId) {
		Faculty faculty = facultyDAO.findFacultyByPrimaryKey(facultybycommitteemember4_facultyId, -1, -1);

		ModelAndView mav = new ModelAndView();
		mav.addObject("thesiscommittee_thesisCommitteeId", thesiscommittee_thesisCommitteeId);
		mav.addObject("faculty", faculty);
		mav.setViewName("thesiscommittee/facultybycommitteemember4/viewFacultyByCommitteeMember4");

		return mav;
	}

	/**
	 * Edit an existing Thesis entity
	 * 
	 */
	@RequestMapping("/editThesiscommitteeThesises")
	public ModelAndView editThesiscommitteeThesises(@RequestParam Integer thesiscommittee_thesisCommitteeId, @RequestParam Integer thesises_thesisId) {
		Thesis thesis = thesisDAO.findThesisByPrimaryKey(thesises_thesisId, -1, -1);

		ModelAndView mav = new ModelAndView();
		mav.addObject("thesiscommittee_thesisCommitteeId", thesiscommittee_thesisCommitteeId);
		mav.addObject("thesis", thesis);
		mav.setViewName("thesiscommittee/thesises/editThesises");

		return mav;
	}

	/**
	 * View an existing Faculty entity
	 * 
	 */
	@RequestMapping("/selectThesiscommitteeFacultyByCommitteeMember5")
	public ModelAndView selectThesiscommitteeFacultyByCommitteeMember5(@RequestParam Integer thesiscommittee_thesisCommitteeId, @RequestParam Integer facultybycommitteemember5_facultyId) {
		Faculty faculty = facultyDAO.findFacultyByPrimaryKey(facultybycommitteemember5_facultyId, -1, -1);

		ModelAndView mav = new ModelAndView();
		mav.addObject("thesiscommittee_thesisCommitteeId", thesiscommittee_thesisCommitteeId);
		mav.addObject("faculty", faculty);
		mav.setViewName("thesiscommittee/facultybycommitteemember5/viewFacultyByCommitteeMember5");

		return mav;
	}

	/**
	 * Select the child Faculty entity for display allowing the user to confirm that they would like to delete the entity
	 * 
	 */
	@RequestMapping("/confirmDeleteThesiscommitteeFacultyByCommitteeMember5")
	public ModelAndView confirmDeleteThesiscommitteeFacultyByCommitteeMember5(@RequestParam Integer thesiscommittee_thesisCommitteeId, @RequestParam Integer related_facultybycommitteemember5_facultyId) {
		ModelAndView mav = new ModelAndView();

		mav.addObject("faculty", facultyDAO.findFacultyByPrimaryKey(related_facultybycommitteemember5_facultyId));
		mav.addObject("thesiscommittee_thesisCommitteeId", thesiscommittee_thesisCommitteeId);
		mav.setViewName("thesiscommittee/facultybycommitteemember5/deleteFacultyByCommitteeMember5");

		return mav;
	}

	/**
	 * Select the child Faculty entity for display allowing the user to confirm that they would like to delete the entity
	 * 
	 */
	@RequestMapping("/confirmDeleteThesiscommitteeFacultyByCommitteeMember3")
	public ModelAndView confirmDeleteThesiscommitteeFacultyByCommitteeMember3(@RequestParam Integer thesiscommittee_thesisCommitteeId, @RequestParam Integer related_facultybycommitteemember3_facultyId) {
		ModelAndView mav = new ModelAndView();

		mav.addObject("faculty", facultyDAO.findFacultyByPrimaryKey(related_facultybycommitteemember3_facultyId));
		mav.addObject("thesiscommittee_thesisCommitteeId", thesiscommittee_thesisCommitteeId);
		mav.setViewName("thesiscommittee/facultybycommitteemember3/deleteFacultyByCommitteeMember3");

		return mav;
	}

	/**
	 * Show all Faculty entities by Thesiscommittee
	 * 
	 */
	@RequestMapping("/listThesiscommitteeFacultyByCommitteeMember5")
	public ModelAndView listThesiscommitteeFacultyByCommitteeMember5(@RequestParam Integer thesisCommitteeIdKey) {
		ModelAndView mav = new ModelAndView();

		mav.addObject("thesiscommittee", thesiscommitteeDAO.findThesiscommitteeByPrimaryKey(thesisCommitteeIdKey));
		mav.setViewName("thesiscommittee/facultybycommitteemember5/listFacultyByCommitteeMember5");

		return mav;
	}

	/**
	 * Create a new Faculty entity
	 * 
	 */
	@RequestMapping("/newThesiscommitteeFacultyByCommitteeMember2")
	public ModelAndView newThesiscommitteeFacultyByCommitteeMember2(@RequestParam Integer thesiscommittee_thesisCommitteeId) {
		ModelAndView mav = new ModelAndView();
		mav.addObject("thesiscommittee_thesisCommitteeId", thesiscommittee_thesisCommitteeId);
		mav.addObject("faculty", new Faculty());
		mav.addObject("newFlag", true);
		mav.setViewName("thesiscommittee/facultybycommitteemember2/editFacultyByCommitteeMember2");

		return mav;
	}

	/**
	 * Save an existing Thesiscommittee entity
	 * 
	 */
	@RequestMapping("/saveThesiscommittee")
	public String saveThesiscommittee(@ModelAttribute Thesiscommittee thesiscommittee) {
		thesiscommitteeService.saveThesiscommittee(thesiscommittee);
		return "forward:/indexThesiscommittee";
	}

	/**
	 * Delete an existing Faculty entity
	 * 
	 */
	@RequestMapping("/deleteThesiscommitteeFacultyByChair")
	public ModelAndView deleteThesiscommitteeFacultyByChair(@RequestParam Integer thesiscommittee_thesisCommitteeId, @RequestParam Integer related_facultybychair_facultyId) {
		ModelAndView mav = new ModelAndView();

		Thesiscommittee thesiscommittee = thesiscommitteeService.deleteThesiscommitteeFacultyByChair(thesiscommittee_thesisCommitteeId, related_facultybychair_facultyId);

		mav.addObject("thesiscommittee_thesisCommitteeId", thesiscommittee_thesisCommitteeId);
		mav.addObject("thesiscommittee", thesiscommittee);
		mav.setViewName("thesiscommittee/viewThesiscommittee");

		return mav;
	}

	/**
	 * Show all Faculty entities by Thesiscommittee
	 * 
	 */
	@RequestMapping("/listThesiscommitteeFacultyByChair")
	public ModelAndView listThesiscommitteeFacultyByChair(@RequestParam Integer thesisCommitteeIdKey) {
		ModelAndView mav = new ModelAndView();

		mav.addObject("thesiscommittee", thesiscommitteeDAO.findThesiscommitteeByPrimaryKey(thesisCommitteeIdKey));
		mav.setViewName("thesiscommittee/facultybychair/listFacultyByChair");

		return mav;
	}

	/**
	 * Show all Thesis entities by Thesiscommittee
	 * 
	 */
	@RequestMapping("/listThesiscommitteeThesises")
	public ModelAndView listThesiscommitteeThesises(@RequestParam Integer thesisCommitteeIdKey) {
		ModelAndView mav = new ModelAndView();

		mav.addObject("thesiscommittee", thesiscommitteeDAO.findThesiscommitteeByPrimaryKey(thesisCommitteeIdKey));
		mav.setViewName("thesiscommittee/thesises/listThesises");

		return mav;
	}

	/**
	 * Save an existing Faculty entity
	 * 
	 */
	@RequestMapping("/saveThesiscommitteeFacultyByChair")
	public ModelAndView saveThesiscommitteeFacultyByChair(@RequestParam Integer thesiscommittee_thesisCommitteeId, @ModelAttribute Faculty facultybychair) {
		Thesiscommittee parent_thesiscommittee = thesiscommitteeService.saveThesiscommitteeFacultyByChair(thesiscommittee_thesisCommitteeId, facultybychair);

		ModelAndView mav = new ModelAndView();
		mav.addObject("thesiscommittee_thesisCommitteeId", thesiscommittee_thesisCommitteeId);
		mav.addObject("thesiscommittee", parent_thesiscommittee);
		mav.setViewName("thesiscommittee/viewThesiscommittee");

		return mav;
	}

	/**
	 * Save an existing Faculty entity
	 * 
	 */
	@RequestMapping("/saveThesiscommitteeFacultyByCommitteeMember3")
	public ModelAndView saveThesiscommitteeFacultyByCommitteeMember3(@RequestParam Integer thesiscommittee_thesisCommitteeId, @ModelAttribute Faculty facultybycommitteemember3) {
		Thesiscommittee parent_thesiscommittee = thesiscommitteeService.saveThesiscommitteeFacultyByCommitteeMember3(thesiscommittee_thesisCommitteeId, facultybycommitteemember3);

		ModelAndView mav = new ModelAndView();
		mav.addObject("thesiscommittee_thesisCommitteeId", thesiscommittee_thesisCommitteeId);
		mav.addObject("thesiscommittee", parent_thesiscommittee);
		mav.setViewName("thesiscommittee/viewThesiscommittee");

		return mav;
	}

	/**
	 * Save an existing Faculty entity
	 * 
	 */
	@RequestMapping("/saveThesiscommitteeFacultyByCommitteeMember5")
	public ModelAndView saveThesiscommitteeFacultyByCommitteeMember5(@RequestParam Integer thesiscommittee_thesisCommitteeId, @ModelAttribute Faculty facultybycommitteemember5) {
		Thesiscommittee parent_thesiscommittee = thesiscommitteeService.saveThesiscommitteeFacultyByCommitteeMember5(thesiscommittee_thesisCommitteeId, facultybycommitteemember5);

		ModelAndView mav = new ModelAndView();
		mav.addObject("thesiscommittee_thesisCommitteeId", thesiscommittee_thesisCommitteeId);
		mav.addObject("thesiscommittee", parent_thesiscommittee);
		mav.setViewName("thesiscommittee/viewThesiscommittee");

		return mav;
	}

	/**
	 * Register custom, context-specific property editors
	 * 
	 */
	@InitBinder
	public void initBinder(WebDataBinder binder, HttpServletRequest request) { // Register static property editors.
		binder.registerCustomEditor(java.util.Calendar.class, new org.skyway.spring.util.databinding.CustomCalendarEditor());
		binder.registerCustomEditor(byte[].class, new org.springframework.web.multipart.support.ByteArrayMultipartFileEditor());
		binder.registerCustomEditor(boolean.class, new org.skyway.spring.util.databinding.EnhancedBooleanEditor(false));
		binder.registerCustomEditor(Boolean.class, new org.skyway.spring.util.databinding.EnhancedBooleanEditor(true));
		binder.registerCustomEditor(java.math.BigDecimal.class, new org.skyway.spring.util.databinding.NaNHandlingNumberEditor(java.math.BigDecimal.class, true));
		binder.registerCustomEditor(Integer.class, new org.skyway.spring.util.databinding.NaNHandlingNumberEditor(Integer.class, true));
		binder.registerCustomEditor(java.util.Date.class, new org.skyway.spring.util.databinding.CustomDateEditor());
		binder.registerCustomEditor(String.class, new org.skyway.spring.util.databinding.StringEditor());
		binder.registerCustomEditor(Long.class, new org.skyway.spring.util.databinding.NaNHandlingNumberEditor(Long.class, true));
		binder.registerCustomEditor(Double.class, new org.skyway.spring.util.databinding.NaNHandlingNumberEditor(Double.class, true));
	}

	/**
	 * Create a new Faculty entity
	 * 
	 */
	@RequestMapping("/newThesiscommitteeFacultyByChair")
	public ModelAndView newThesiscommitteeFacultyByChair(@RequestParam Integer thesiscommittee_thesisCommitteeId) {
		ModelAndView mav = new ModelAndView();
		mav.addObject("thesiscommittee_thesisCommitteeId", thesiscommittee_thesisCommitteeId);
		mav.addObject("faculty", new Faculty());
		mav.addObject("newFlag", true);
		mav.setViewName("thesiscommittee/facultybychair/editFacultyByChair");

		return mav;
	}

	/**
	 * Edit an existing Faculty entity
	 * 
	 */
	@RequestMapping("/editThesiscommitteeFacultyByCommitteeMember5")
	public ModelAndView editThesiscommitteeFacultyByCommitteeMember5(@RequestParam Integer thesiscommittee_thesisCommitteeId, @RequestParam Integer facultybycommitteemember5_facultyId) {
		Faculty faculty = facultyDAO.findFacultyByPrimaryKey(facultybycommitteemember5_facultyId, -1, -1);

		ModelAndView mav = new ModelAndView();
		mav.addObject("thesiscommittee_thesisCommitteeId", thesiscommittee_thesisCommitteeId);
		mav.addObject("faculty", faculty);
		mav.setViewName("thesiscommittee/facultybycommitteemember5/editFacultyByCommitteeMember5");

		return mav;
	}

	/**
	 */
	@RequestMapping("/thesiscommitteeController/binary.action")
	public ModelAndView streamBinary(@ModelAttribute HttpServletRequest request, @ModelAttribute HttpServletResponse response) {
		ModelAndView mav = new ModelAndView();
		mav.setViewName("streamedBinaryContentView");
		return mav;

	}

	/**
	 * Create a new Thesiscommittee entity
	 * 
	 */
	@RequestMapping("/newThesiscommittee")
	public ModelAndView newThesiscommittee() {
		ModelAndView mav = new ModelAndView();

		mav.addObject("thesiscommittee", new Thesiscommittee());
		mav.addObject("newFlag", true);
		mav.setViewName("thesiscommittee/editThesiscommittee");

		return mav;
	}

	/**
	 * Edit an existing Faculty entity
	 * 
	 */
	@RequestMapping("/editThesiscommitteeFacultyByCommitteeMember2")
	public ModelAndView editThesiscommitteeFacultyByCommitteeMember2(@RequestParam Integer thesiscommittee_thesisCommitteeId, @RequestParam Integer facultybycommitteemember2_facultyId) {
		Faculty faculty = facultyDAO.findFacultyByPrimaryKey(facultybycommitteemember2_facultyId, -1, -1);

		ModelAndView mav = new ModelAndView();
		mav.addObject("thesiscommittee_thesisCommitteeId", thesiscommittee_thesisCommitteeId);
		mav.addObject("faculty", faculty);
		mav.setViewName("thesiscommittee/facultybycommitteemember2/editFacultyByCommitteeMember2");

		return mav;
	}

	/**
	 * Delete an existing Faculty entity
	 * 
	 */
	@RequestMapping("/deleteThesiscommitteeFacultyByCommitteeMember1")
	public ModelAndView deleteThesiscommitteeFacultyByCommitteeMember1(@RequestParam Integer thesiscommittee_thesisCommitteeId, @RequestParam Integer related_facultybycommitteemember1_facultyId) {
		ModelAndView mav = new ModelAndView();

		Thesiscommittee thesiscommittee = thesiscommitteeService.deleteThesiscommitteeFacultyByCommitteeMember1(thesiscommittee_thesisCommitteeId, related_facultybycommitteemember1_facultyId);

		mav.addObject("thesiscommittee_thesisCommitteeId", thesiscommittee_thesisCommitteeId);
		mav.addObject("thesiscommittee", thesiscommittee);
		mav.setViewName("thesiscommittee/viewThesiscommittee");

		return mav;
	}

	/**
	 * Edit an existing Thesiscommittee entity
	 * 
	 */
	@RequestMapping("/editThesiscommittee")
	public ModelAndView editThesiscommittee(@RequestParam Integer thesisCommitteeIdKey) {
		ModelAndView mav = new ModelAndView();

		mav.addObject("thesiscommittee", thesiscommitteeDAO.findThesiscommitteeByPrimaryKey(thesisCommitteeIdKey));
		mav.setViewName("thesiscommittee/editThesiscommittee");

		return mav;
	}

	/**
	 * Delete an existing Faculty entity
	 * 
	 */
	@RequestMapping("/deleteThesiscommitteeFacultyByCommitteeMember2")
	public ModelAndView deleteThesiscommitteeFacultyByCommitteeMember2(@RequestParam Integer thesiscommittee_thesisCommitteeId, @RequestParam Integer related_facultybycommitteemember2_facultyId) {
		ModelAndView mav = new ModelAndView();

		Thesiscommittee thesiscommittee = thesiscommitteeService.deleteThesiscommitteeFacultyByCommitteeMember2(thesiscommittee_thesisCommitteeId, related_facultybycommitteemember2_facultyId);

		mav.addObject("thesiscommittee_thesisCommitteeId", thesiscommittee_thesisCommitteeId);
		mav.addObject("thesiscommittee", thesiscommittee);
		mav.setViewName("thesiscommittee/viewThesiscommittee");

		return mav;
	}

	/**
	 * Save an existing Faculty entity
	 * 
	 */
	@RequestMapping("/saveThesiscommitteeFacultyByCommitteeMember4")
	public ModelAndView saveThesiscommitteeFacultyByCommitteeMember4(@RequestParam Integer thesiscommittee_thesisCommitteeId, @ModelAttribute Faculty facultybycommitteemember4) {
		Thesiscommittee parent_thesiscommittee = thesiscommitteeService.saveThesiscommitteeFacultyByCommitteeMember4(thesiscommittee_thesisCommitteeId, facultybycommitteemember4);

		ModelAndView mav = new ModelAndView();
		mav.addObject("thesiscommittee_thesisCommitteeId", thesiscommittee_thesisCommitteeId);
		mav.addObject("thesiscommittee", parent_thesiscommittee);
		mav.setViewName("thesiscommittee/viewThesiscommittee");

		return mav;
	}

	/**
	 * Edit an existing Faculty entity
	 * 
	 */
	@RequestMapping("/editThesiscommitteeFacultyByCommitteeMember4")
	public ModelAndView editThesiscommitteeFacultyByCommitteeMember4(@RequestParam Integer thesiscommittee_thesisCommitteeId, @RequestParam Integer facultybycommitteemember4_facultyId) {
		Faculty faculty = facultyDAO.findFacultyByPrimaryKey(facultybycommitteemember4_facultyId, -1, -1);

		ModelAndView mav = new ModelAndView();
		mav.addObject("thesiscommittee_thesisCommitteeId", thesiscommittee_thesisCommitteeId);
		mav.addObject("faculty", faculty);
		mav.setViewName("thesiscommittee/facultybycommitteemember4/editFacultyByCommitteeMember4");

		return mav;
	}

	/**
	 * Create a new Faculty entity
	 * 
	 */
	@RequestMapping("/newThesiscommitteeFacultyByCommitteeMember1")
	public ModelAndView newThesiscommitteeFacultyByCommitteeMember1(@RequestParam Integer thesiscommittee_thesisCommitteeId) {
		ModelAndView mav = new ModelAndView();
		mav.addObject("thesiscommittee_thesisCommitteeId", thesiscommittee_thesisCommitteeId);
		mav.addObject("faculty", new Faculty());
		mav.addObject("newFlag", true);
		mav.setViewName("thesiscommittee/facultybycommitteemember1/editFacultyByCommitteeMember1");

		return mav;
	}

	/**
	 * Save an existing Faculty entity
	 * 
	 */
	@RequestMapping("/saveThesiscommitteeFacultyByCommitteeMember1")
	public ModelAndView saveThesiscommitteeFacultyByCommitteeMember1(@RequestParam Integer thesiscommittee_thesisCommitteeId, @ModelAttribute Faculty facultybycommitteemember1) {
		Thesiscommittee parent_thesiscommittee = thesiscommitteeService.saveThesiscommitteeFacultyByCommitteeMember1(thesiscommittee_thesisCommitteeId, facultybycommitteemember1);

		ModelAndView mav = new ModelAndView();
		mav.addObject("thesiscommittee_thesisCommitteeId", thesiscommittee_thesisCommitteeId);
		mav.addObject("thesiscommittee", parent_thesiscommittee);
		mav.setViewName("thesiscommittee/viewThesiscommittee");

		return mav;
	}

	/**
	 * Create a new Faculty entity
	 * 
	 */
	@RequestMapping("/newThesiscommitteeFacultyByCommitteeMember4")
	public ModelAndView newThesiscommitteeFacultyByCommitteeMember4(@RequestParam Integer thesiscommittee_thesisCommitteeId) {
		ModelAndView mav = new ModelAndView();
		mav.addObject("thesiscommittee_thesisCommitteeId", thesiscommittee_thesisCommitteeId);
		mav.addObject("faculty", new Faculty());
		mav.addObject("newFlag", true);
		mav.setViewName("thesiscommittee/facultybycommitteemember4/editFacultyByCommitteeMember4");

		return mav;
	}

	/**
	 * Select the child Faculty entity for display allowing the user to confirm that they would like to delete the entity
	 * 
	 */
	@RequestMapping("/confirmDeleteThesiscommitteeFacultyByChair")
	public ModelAndView confirmDeleteThesiscommitteeFacultyByChair(@RequestParam Integer thesiscommittee_thesisCommitteeId, @RequestParam Integer related_facultybychair_facultyId) {
		ModelAndView mav = new ModelAndView();

		mav.addObject("faculty", facultyDAO.findFacultyByPrimaryKey(related_facultybychair_facultyId));
		mav.addObject("thesiscommittee_thesisCommitteeId", thesiscommittee_thesisCommitteeId);
		mav.setViewName("thesiscommittee/facultybychair/deleteFacultyByChair");

		return mav;
	}

	/**
	 * Edit an existing Faculty entity
	 * 
	 */
	@RequestMapping("/editThesiscommitteeFacultyByCommitteeMember1")
	public ModelAndView editThesiscommitteeFacultyByCommitteeMember1(@RequestParam Integer thesiscommittee_thesisCommitteeId, @RequestParam Integer facultybycommitteemember1_facultyId) {
		Faculty faculty = facultyDAO.findFacultyByPrimaryKey(facultybycommitteemember1_facultyId, -1, -1);

		ModelAndView mav = new ModelAndView();
		mav.addObject("thesiscommittee_thesisCommitteeId", thesiscommittee_thesisCommitteeId);
		mav.addObject("faculty", faculty);
		mav.setViewName("thesiscommittee/facultybycommitteemember1/editFacultyByCommitteeMember1");

		return mav;
	}

	/**
	 * Delete an existing Thesiscommittee entity
	 * 
	 */
	@RequestMapping("/deleteThesiscommittee")
	public String deleteThesiscommittee(@RequestParam Integer thesisCommitteeIdKey) {
		Thesiscommittee thesiscommittee = thesiscommitteeDAO.findThesiscommitteeByPrimaryKey(thesisCommitteeIdKey);
		thesiscommitteeService.deleteThesiscommittee(thesiscommittee);
		return "forward:/indexThesiscommittee";
	}

	/**
	 * Show all Faculty entities by Thesiscommittee
	 * 
	 */
	@RequestMapping("/listThesiscommitteeFacultyByCommitteeMember2")
	public ModelAndView listThesiscommitteeFacultyByCommitteeMember2(@RequestParam Integer thesisCommitteeIdKey) {
		ModelAndView mav = new ModelAndView();

		mav.addObject("thesiscommittee", thesiscommitteeDAO.findThesiscommitteeByPrimaryKey(thesisCommitteeIdKey));
		mav.setViewName("thesiscommittee/facultybycommitteemember2/listFacultyByCommitteeMember2");

		return mav;
	}

	/**
	 * Select the child Faculty entity for display allowing the user to confirm that they would like to delete the entity
	 * 
	 */
	@RequestMapping("/confirmDeleteThesiscommitteeFacultyByCommitteeMember1")
	public ModelAndView confirmDeleteThesiscommitteeFacultyByCommitteeMember1(@RequestParam Integer thesiscommittee_thesisCommitteeId, @RequestParam Integer related_facultybycommitteemember1_facultyId) {
		ModelAndView mav = new ModelAndView();

		mav.addObject("faculty", facultyDAO.findFacultyByPrimaryKey(related_facultybycommitteemember1_facultyId));
		mav.addObject("thesiscommittee_thesisCommitteeId", thesiscommittee_thesisCommitteeId);
		mav.setViewName("thesiscommittee/facultybycommitteemember1/deleteFacultyByCommitteeMember1");

		return mav;
	}

	/**
	 * Save an existing Thesis entity
	 * 
	 */
	@RequestMapping("/saveThesiscommitteeThesises")
	public ModelAndView saveThesiscommitteeThesises(@RequestParam Integer thesiscommittee_thesisCommitteeId, @ModelAttribute Thesis thesises) {
		Thesiscommittee parent_thesiscommittee = thesiscommitteeService.saveThesiscommitteeThesises(thesiscommittee_thesisCommitteeId, thesises);

		ModelAndView mav = new ModelAndView();
		mav.addObject("thesiscommittee_thesisCommitteeId", thesiscommittee_thesisCommitteeId);
		mav.addObject("thesiscommittee", parent_thesiscommittee);
		mav.setViewName("thesiscommittee/viewThesiscommittee");

		return mav;
	}

	/**
	 * Delete an existing Faculty entity
	 * 
	 */
	@RequestMapping("/deleteThesiscommitteeFacultyByCommitteeMember5")
	public ModelAndView deleteThesiscommitteeFacultyByCommitteeMember5(@RequestParam Integer thesiscommittee_thesisCommitteeId, @RequestParam Integer related_facultybycommitteemember5_facultyId) {
		ModelAndView mav = new ModelAndView();

		Thesiscommittee thesiscommittee = thesiscommitteeService.deleteThesiscommitteeFacultyByCommitteeMember5(thesiscommittee_thesisCommitteeId, related_facultybycommitteemember5_facultyId);

		mav.addObject("thesiscommittee_thesisCommitteeId", thesiscommittee_thesisCommitteeId);
		mav.addObject("thesiscommittee", thesiscommittee);
		mav.setViewName("thesiscommittee/viewThesiscommittee");

		return mav;
	}

	/**
	 * View an existing Faculty entity
	 * 
	 */
	@RequestMapping("/selectThesiscommitteeFacultyByChair")
	public ModelAndView selectThesiscommitteeFacultyByChair(@RequestParam Integer thesiscommittee_thesisCommitteeId, @RequestParam Integer facultybychair_facultyId) {
		Faculty faculty = facultyDAO.findFacultyByPrimaryKey(facultybychair_facultyId, -1, -1);

		ModelAndView mav = new ModelAndView();
		mav.addObject("thesiscommittee_thesisCommitteeId", thesiscommittee_thesisCommitteeId);
		mav.addObject("faculty", faculty);
		mav.setViewName("thesiscommittee/facultybychair/viewFacultyByChair");

		return mav;
	}

	/**
	 * Show all Thesiscommittee entities
	 * 
	 */
	@RequestMapping("/indexThesiscommittee")
	public String listThesiscommittees(Model model) {
		model.addAttribute("thesiscommittees", thesiscommitteeService.loadThesiscommittees());
		return "thesiscommittee/listThesiscommittees";
	}

	/**
	 * View an existing Faculty entity
	 * 
	 */
	@RequestMapping("/selectThesiscommitteeFacultyByCommitteeMember3")
	public ModelAndView selectThesiscommitteeFacultyByCommitteeMember3(@RequestParam Integer thesiscommittee_thesisCommitteeId, @RequestParam Integer facultybycommitteemember3_facultyId) {
		Faculty faculty = facultyDAO.findFacultyByPrimaryKey(facultybycommitteemember3_facultyId, -1, -1);

		ModelAndView mav = new ModelAndView();
		mav.addObject("thesiscommittee_thesisCommitteeId", thesiscommittee_thesisCommitteeId);
		mav.addObject("faculty", faculty);
		mav.setViewName("thesiscommittee/facultybycommitteemember3/viewFacultyByCommitteeMember3");

		return mav;
	}

	/**
	 * View an existing Thesis entity
	 * 
	 */
	@RequestMapping("/selectThesiscommitteeThesises")
	public ModelAndView selectThesiscommitteeThesises(@RequestParam Integer thesiscommittee_thesisCommitteeId, @RequestParam Integer thesises_thesisId) {
		Thesis thesis = thesisDAO.findThesisByPrimaryKey(thesises_thesisId, -1, -1);

		ModelAndView mav = new ModelAndView();
		mav.addObject("thesiscommittee_thesisCommitteeId", thesiscommittee_thesisCommitteeId);
		mav.addObject("thesis", thesis);
		mav.setViewName("thesiscommittee/thesises/viewThesises");

		return mav;
	}

	/**
	 * Delete an existing Faculty entity
	 * 
	 */
	@RequestMapping("/deleteThesiscommitteeFacultyByCommitteeMember3")
	public ModelAndView deleteThesiscommitteeFacultyByCommitteeMember3(@RequestParam Integer thesiscommittee_thesisCommitteeId, @RequestParam Integer related_facultybycommitteemember3_facultyId) {
		ModelAndView mav = new ModelAndView();

		Thesiscommittee thesiscommittee = thesiscommitteeService.deleteThesiscommitteeFacultyByCommitteeMember3(thesiscommittee_thesisCommitteeId, related_facultybycommitteemember3_facultyId);

		mav.addObject("thesiscommittee_thesisCommitteeId", thesiscommittee_thesisCommitteeId);
		mav.addObject("thesiscommittee", thesiscommittee);
		mav.setViewName("thesiscommittee/viewThesiscommittee");

		return mav;
	}

	/**
	 * Select the child Thesis entity for display allowing the user to confirm that they would like to delete the entity
	 * 
	 */
	@RequestMapping("/confirmDeleteThesiscommitteeThesises")
	public ModelAndView confirmDeleteThesiscommitteeThesises(@RequestParam Integer thesiscommittee_thesisCommitteeId, @RequestParam Integer related_thesises_thesisId) {
		ModelAndView mav = new ModelAndView();

		mav.addObject("thesis", thesisDAO.findThesisByPrimaryKey(related_thesises_thesisId));
		mav.addObject("thesiscommittee_thesisCommitteeId", thesiscommittee_thesisCommitteeId);
		mav.setViewName("thesiscommittee/thesises/deleteThesises");

		return mav;
	}

	/**
	 * Show all Faculty entities by Thesiscommittee
	 * 
	 */
	@RequestMapping("/listThesiscommitteeFacultyByCommitteeMember4")
	public ModelAndView listThesiscommitteeFacultyByCommitteeMember4(@RequestParam Integer thesisCommitteeIdKey) {
		ModelAndView mav = new ModelAndView();

		mav.addObject("thesiscommittee", thesiscommitteeDAO.findThesiscommitteeByPrimaryKey(thesisCommitteeIdKey));
		mav.setViewName("thesiscommittee/facultybycommitteemember4/listFacultyByCommitteeMember4");

		return mav;
	}

	/**
	 * View an existing Faculty entity
	 * 
	 */
	@RequestMapping("/selectThesiscommitteeFacultyByCommitteeMember2")
	public ModelAndView selectThesiscommitteeFacultyByCommitteeMember2(@RequestParam Integer thesiscommittee_thesisCommitteeId, @RequestParam Integer facultybycommitteemember2_facultyId) {
		Faculty faculty = facultyDAO.findFacultyByPrimaryKey(facultybycommitteemember2_facultyId, -1, -1);

		ModelAndView mav = new ModelAndView();
		mav.addObject("thesiscommittee_thesisCommitteeId", thesiscommittee_thesisCommitteeId);
		mav.addObject("faculty", faculty);
		mav.setViewName("thesiscommittee/facultybycommitteemember2/viewFacultyByCommitteeMember2");

		return mav;
	}

	/**
	 * Edit an existing Faculty entity
	 * 
	 */
	@RequestMapping("/editThesiscommitteeFacultyByCommitteeMember3")
	public ModelAndView editThesiscommitteeFacultyByCommitteeMember3(@RequestParam Integer thesiscommittee_thesisCommitteeId, @RequestParam Integer facultybycommitteemember3_facultyId) {
		Faculty faculty = facultyDAO.findFacultyByPrimaryKey(facultybycommitteemember3_facultyId, -1, -1);

		ModelAndView mav = new ModelAndView();
		mav.addObject("thesiscommittee_thesisCommitteeId", thesiscommittee_thesisCommitteeId);
		mav.addObject("faculty", faculty);
		mav.setViewName("thesiscommittee/facultybycommitteemember3/editFacultyByCommitteeMember3");

		return mav;
	}

	/**
	 * Delete an existing Faculty entity
	 * 
	 */
	@RequestMapping("/deleteThesiscommitteeFacultyByCommitteeMember4")
	public ModelAndView deleteThesiscommitteeFacultyByCommitteeMember4(@RequestParam Integer thesiscommittee_thesisCommitteeId, @RequestParam Integer related_facultybycommitteemember4_facultyId) {
		ModelAndView mav = new ModelAndView();

		Thesiscommittee thesiscommittee = thesiscommitteeService.deleteThesiscommitteeFacultyByCommitteeMember4(thesiscommittee_thesisCommitteeId, related_facultybycommitteemember4_facultyId);

		mav.addObject("thesiscommittee_thesisCommitteeId", thesiscommittee_thesisCommitteeId);
		mav.addObject("thesiscommittee", thesiscommittee);
		mav.setViewName("thesiscommittee/viewThesiscommittee");

		return mav;
	}

	/**
	 * Show all Faculty entities by Thesiscommittee
	 * 
	 */
	@RequestMapping("/listThesiscommitteeFacultyByCommitteeMember1")
	public ModelAndView listThesiscommitteeFacultyByCommitteeMember1(@RequestParam Integer thesisCommitteeIdKey) {
		ModelAndView mav = new ModelAndView();

		mav.addObject("thesiscommittee", thesiscommitteeDAO.findThesiscommitteeByPrimaryKey(thesisCommitteeIdKey));
		mav.setViewName("thesiscommittee/facultybycommitteemember1/listFacultyByCommitteeMember1");

		return mav;
	}

	/**
	 * Edit an existing Faculty entity
	 * 
	 */
	@RequestMapping("/editThesiscommitteeFacultyByChair")
	public ModelAndView editThesiscommitteeFacultyByChair(@RequestParam Integer thesiscommittee_thesisCommitteeId, @RequestParam Integer facultybychair_facultyId) {
		Faculty faculty = facultyDAO.findFacultyByPrimaryKey(facultybychair_facultyId, -1, -1);

		ModelAndView mav = new ModelAndView();
		mav.addObject("thesiscommittee_thesisCommitteeId", thesiscommittee_thesisCommitteeId);
		mav.addObject("faculty", faculty);
		mav.setViewName("thesiscommittee/facultybychair/editFacultyByChair");

		return mav;
	}

	/**
	 * Save an existing Faculty entity
	 * 
	 */
	@RequestMapping("/saveThesiscommitteeFacultyByCommitteeMember2")
	public ModelAndView saveThesiscommitteeFacultyByCommitteeMember2(@RequestParam Integer thesiscommittee_thesisCommitteeId, @ModelAttribute Faculty facultybycommitteemember2) {
		Thesiscommittee parent_thesiscommittee = thesiscommitteeService.saveThesiscommitteeFacultyByCommitteeMember2(thesiscommittee_thesisCommitteeId, facultybycommitteemember2);

		ModelAndView mav = new ModelAndView();
		mav.addObject("thesiscommittee_thesisCommitteeId", thesiscommittee_thesisCommitteeId);
		mav.addObject("thesiscommittee", parent_thesiscommittee);
		mav.setViewName("thesiscommittee/viewThesiscommittee");

		return mav;
	}

	/**
	 * Entry point to show all Thesiscommittee entities
	 * 
	 */
	public String indexThesiscommittee() {
		return "redirect:/indexThesiscommittee";
	}

	/**
	 * Select the child Faculty entity for display allowing the user to confirm that they would like to delete the entity
	 * 
	 */
	@RequestMapping("/confirmDeleteThesiscommitteeFacultyByCommitteeMember4")
	public ModelAndView confirmDeleteThesiscommitteeFacultyByCommitteeMember4(@RequestParam Integer thesiscommittee_thesisCommitteeId, @RequestParam Integer related_facultybycommitteemember4_facultyId) {
		ModelAndView mav = new ModelAndView();

		mav.addObject("faculty", facultyDAO.findFacultyByPrimaryKey(related_facultybycommitteemember4_facultyId));
		mav.addObject("thesiscommittee_thesisCommitteeId", thesiscommittee_thesisCommitteeId);
		mav.setViewName("thesiscommittee/facultybycommitteemember4/deleteFacultyByCommitteeMember4");

		return mav;
	}
}